const http = require('http');
const fs = require('fs');

http.createServer((req, res) => {
  console.log(req.url);
  fs.readFile(`www${req.url}`, (err, data) => {
    if (err) {
      res.writeHeader(404);
      res.write('Not found');
      res.end()

    } else {
      res.write(data);
      res.end();

    }


  })


}).listen(2344)